<template>
	<view class="business">
		<view class="nav d_f j_c_c a_i_c">
			<view class="text">USDR-TRC20 Shipping address</view>
			<image src="../../static/ct_0031_返回键.png" mode="" class="right" @tap="back"></image>
		</view>
		<image src="../../static/ct_0039_绿色顶2.png" mode="" class="header"></image>
		<view class="index">
			<view class="w_100 h_100 p_r d_f a_i_c f_d_c">
				<image src="../../static/ct_0038_logo.png" mode="" class="logo"></image>
				<image @tap="look($config.imgUrl+data.image)" :src="$config.imgUrl+data.image" mode="" class="code"></image>
				<view class="rule">{{data.address}}</view>
				<view class="d_f j_c_s_b w_100 m_t_20">
					<view class="button d_f j_c_c a_i_c" @tap="copy">copy</view>
					<view class="button d_f j_c_c a_i_c" @tap="confirm">confirm</view>
				</view>
				<view class="tips">Please check the type of virtual currency you transferred in. Other types of virtual
					currency will not be recovered after being transferred in</view>
			</view>
		</view>

	</view>
</template>

<script>
	export default {
		data() {
			return {
				data:{},
			}
		},
		components: {

		},
		methods: {
			back() {
				uni.navigateBack({
					delta: 1
				});
			},
			//获取钱包数据
			getData() {
				this.$api.walletinfo().then(res => {
					this.data = res.data
				})
			},
			copy(){
				let _this=this
				uni.setClipboardData({
					data: _this.data.image, // data的值为你要复制的内容
					success: res => {
						_this.tips()
					},
					fail: err => {
						console.log(err, 'err')
					},
					complete:a=>{
						console.log(a);
					}
				});
			},
			confirm(){
				this.$api.buyTickets({from:uni.getStorageSync('from')}).then(res=>{
					this.$u.toast('success')
				})
			},
			tips(){
				console.log(111);
				 alert('Successfully copied')
			// uni.showToast({
			// 	title: 'Successfully copied',
			// 	icon:'none',
			// 	duration: 2000
			// });	
			},
			look(img){
				 uni.previewImage({
				 			urls: [img],
				 			longPressActions: {
				 				itemList: [ '保存图片',],
				 				success: function(data) {
				 					
				 				},
				 				fail: function(err) {
				 					console.log(err.errMsg);
				 				}
				 			}
				 		});
			}
		},
		onShow() {

		},
		onLoad(options) {
			this.data=uni.getStorageSync('fee')
		},
		watch: {

		},
		computed: {

		}
	}
</script>

<style scoped lang='scss'>
	.business {
		width: 100%;
		min-height: 100%;
		background: rgb(239, 237, 238);
		position: relative;

		.nav {
			width: calc(100% - 64rpx);
			height: 160rpx;
			margin-left: 32rpx;
			position: relative;
			z-index: 9999;

			.text {
				font-size: 32rpx;
				font-weight: 700;
				color: #fff;
			}

			.right {
				width: 20rpx;
				height: 32rpx;
				position: absolute;
				left: 0rpx;
				z-index: 999;
				transform: rotate(180deg);
			}
		}

		.header {
			position: absolute;
			top: 0rpx;
			width: 100%;
			height: 539rpx;
			z-index: 1;
		}



		.index {
			width: calc(100% - 64rpx);
			margin-left: 32rpx;
			margin-top: 100rpx;
			background: #fff;
			height: 800rpx;
			z-index: 9;
			position: absolute;
			border-radius: 20rpx;
			padding: 0rpx 32rpx;

			.logo {
				width: 133rpx;
				height: 133rpx;
			 position: absolute;
			 top: -60rpx;
			}

			.code {
				width: 342rpx;
				height: 326rpx;
				margin-top: 128rpx;
			}

			.rule {
				font-size: 28rpx;
				margin-top: 16rpx;
		 }

			.button {
				
				width: 300rpx;
				height: 70rpx;
				background: rgb(101, 186, 144);
				border-radius: 10rpx;
				color: #fff;
				font-weight: 700;
			}
			.tips{
				font-weight: 700;
				font-size: 24rpx;
				margin-top: 32rpx;
			}
		}


	}
</style>
